﻿# rayzhang qss_theme
# 2023/12/05
project(libflow LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core Gui Widgets Sql)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
#qt_standard_project_setup()

add_library(${PROJECT_NAME} SHARED)

target_sources(${PROJECT_NAME}
    PRIVATE
    "libflow_global.h"
    #
    "exception/exceptions.hpp"
    # json
    "json/json.cpp" "json/json.h"
    # log
    "log/log.hpp" "log/raylog.h" "log/raylog.cpp"
    # math
    "math/float_comparisons.hpp" "math/vector_utils.hpp"
    # 
    "orderedmap/orderedmap.hpp"
    # 
    "orm/orm.h" "orm/orm.cpp" "orm/qconnectionpool.h"
    #
    "range_for/range_for.hpp"
    #
    "reflection/reflection.hpp"
    #
    "router/action_dispatcher.h" "router/action_dispatcher.h" "router/page_router.h" "router/page_router.cpp"
    # 
    "storage/storage.hpp"
    #
    "store/store.hpp"
    #
    "validator/validator.h" "validator/validator.cpp"
)
#target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
target_link_libraries(${PROJECT_NAME} PRIVATE 
    Qt${QT_DEFAULT_MAJOR_VERSION}::Core 
    Qt${QT_DEFAULT_MAJOR_VERSION}::Gui 
    Qt${QT_DEFAULT_MAJOR_VERSION}::Widgets
    Qt${QT_DEFAULT_MAJOR_VERSION}::Sql
)

# debug 输出带d的库
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX d)
# 预处理器/预定义宏
target_compile_definitions(${PROJECT_NAME} PRIVATE LIBFLOW_API_EXPORT)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE_FILES})
